package Node;
import org.jdom.*;

import Connect.Connection;

public class ResolveAddres {
	private String rdfURL;
	private String resURL;
	private String URL;
	
	private Document response;
	
	public ResolveAddres(String rdfURL, String resURL, String URL){
		this.rdfURL = rdfURL;
		this.resURL = resURL;
		this.URL = URL;
	}
	
	public String getValues(){
		Namespace res = Namespace.getNamespace(resURL);
		Namespace rdf = Namespace.getNamespace(rdfURL);
		String value = "";
		
		response = Connection.connect(URL);
		if (null == response)
			return "Gateway Timeout";
		
		Element e = (Element)response.getRootElement().getChildren().get(0);
		value = e.getAttributeValue("hasDecimalValue", res);
		
		return value;
	}
	
}
